package com.yanqu.road.server.cmd.activity.busyfarming;

import com.yanqu.road.pb.activity.BusyFarmingProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_BUSY_FARMING_FRIEND_HOME_DETAIL_BACK,desc = "跨服商会果园详情(区服返回)")
public class CrossBusyFarmingFriendHomeDetailBackCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        BusyFarmingProto.BusyFarmingFriendHomeDetailCrossRespMsg respMsg = BusyFarmingProto.BusyFarmingFriendHomeDetailCrossRespMsg.parseFrom(packet.getBytes());

        BusyFarmingProto.BusyFarmingFriendHomeDetailRespMsg.Builder clientMsg = BusyFarmingProto.BusyFarmingFriendHomeDetailRespMsg.newBuilder();
        clientMsg.setRet(respMsg.getRet());
        clientMsg.setFriend(respMsg.getFriend());

        MessageHelper.sendPacket(respMsg.getSrcServerId(), respMsg.getSrcUserId(), YanQuMessageUtils.buildMessage(Protocol.U_BUSY_FARMING_FRIEND_HOME_DETAIL, clientMsg));
    }

    @Override
    public void sendData() {

    }
}
